# Contributor: Hoang Nguyen <folliekazetani@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=py3-time-machine
pkgver=2.16.0
pkgrel=0
pkgdesc="Python library for mocking the current time"
url="https://github.com/adamchainz/time-machine"
arch="all"
license="MIT"
depends="py3-dateutil"
makedepends="
	python3-dev
	py3-setuptools
	py3-gpep517
	py3-wheel
	"
checkdepends="py3-pytest tzdata"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/adamchainz/time-machine/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/time-machine-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
19b764cccdff07056a7d42841da576d90037661a9f124e3fbab408bfa61dccf4b51b88a7e0741c87b03e7a8cc3306bb0ed32bd66588e45c9ab7e9d9cb5ba44ae  py3-time-machine-2.16.0.tar.gz
"
